package com.example.chainsave.upload.util;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class StringUtil {
    private int blockNO;
    private String ip;
    private int port;

    public void parse(String partitionAddress) {
        String[] strArray = partitionAddress.split(":");
        this.blockNO = Integer.parseInt(strArray[0]);
        this.ip = strArray[1];
        this.port = Integer.parseInt(strArray[2]);
    }
}
